<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>对象属性的声明</title>
</head>
<body>
    <script>
        class User{
            site = "后盾人";
            constructor(name){
                this.name = name;
            }
            changeSite(value){
                this.site = value;
            }
            show(){
                return this.site + this.name;
            }
        }

        let user = new User('xiasnn');
        user.changeSite('hdms');
        console.log(user.show());


        // 每一个对象是单独的，上一个对象修改了changeSite，但这个对象不会被影响
        let hd = new User("xiaxia");
        console.log(hd.show());
    </script>
</body>
</html>